package com.cx.mall.scheduler.job;

import com.cx.mall.scheduler.service.IBuyService;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class LoadStockTask implements SimpleJob {
    @Autowired
    private IBuyService buyService;

    @Override
    public void execute(ShardingContext shardingContext) {
        System.out.println("加载库存任务开始");
        buyService.loadStock();
        System.out.println("加载库存任务结束");
    }
}
